<template>
	<Container>
		<view class="header">
			<view class="article" v-if="isArticleShow">
				<view
					v-for="(item, index) in assignment.optionArticles[current]"
					:key="index"
					:style="{ width: assignment.optionArticles[current].length > 6 ? '33.3%' : '50%' }"
					@tap="tap(item, index)"
					hover-class="touch"
					hover-stay-time="100"
				>
					<image class="img image" :class="{ articleLight: chooses[index] === 'select' }" :src="item.imageUrl" mode="aspectFit"></image>
				</view>
			</view>
			<AudioIcon @iconTap="iconTap" :questionPress="questionPress" />
		</view>
		<Question :question="assignment.questionName" />
		<view class="option"><image class="img" :src="optionSrc" mode="aspectFit"></image></view>
	</Container>
</template>

<script>
import { times } from '../../../common/mixins/assignmentTimes.js'
import { mixins } from '../../../common/mixins/assignmentDefault.js'
import AudioIcon from '../audioIcon.vue'
import Question from '../questionName.vue'
import Container from '../container.vue'
export default {
	mixins: [mixins, times],
	components: { AudioIcon, Question, Container },
	computed: {
		optionSrc() {
			return this.assignment.optionArticles[this.current].filter(item => {
				return item.isMatched
			})[0].imageUrl
		}
	}
}
</script>

<style scoped lang="stylus">
.header
	height 55vh
	width 720rpx
	max-width 65vh
	border-radius 70rpx
	border 12rpx solid #FCC77D
	box-sizing border-box
	margin 5vh 0
	position relative
	.article
		animation outIn 0.4s
		display flex
		justify-content center
		align-items center
		flex-wrap wrap
		height 55vh
		width 720rpx
		view
			width 50%
			height 32%
			display flex
			align-items center
			justify-content center
			transition all 0.3s
			position relative
			.image
				width 80%
				height 80%
.option
	width 15vh
	height 15vh
	border 8rpx solid #FF9A72
	box-sizing border-box
	border-radius 50rpx
	display flex
	align-items center
	justify-content center
	margin 3vh auto
	image
		width 80%
		height 80%
</style>
